package inline;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.telephony.TelephonyManager;

import com.ss.android.lockscreen.utils.NetworkUtils$NetworkType;

public class ConnectionUtils {
    public static NetworkUtils$NetworkType b(Context arg2) {
        NetworkUtils$NetworkType v0_2;
        try {
            NetworkInfo v0_1 = ((ConnectivityManager) arg2.getSystemService(Context.CONNECTIVITY_SERVICE)).getActiveNetworkInfo();
            if (v0_1 == null || !v0_1.isAvailable()) {
                v0_2 = NetworkUtils$NetworkType.NONE;
                return v0_2;
            }

            int v0_3 = v0_1.getType();
            if (1 == v0_3) {
                return NetworkUtils$NetworkType.WIFI;
            }

            if (v0_3 != 0) {
                return NetworkUtils$NetworkType.MOBILE;
            }

            switch (((TelephonyManager) arg2.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkType()) {
                case 13: {
                    return NetworkUtils$NetworkType.MOBILE_4G;
                }
                case 3:
                case 5:
                case 6:
                case 8:
                case 9:
                case 10:
                case 12:
                case 14:
                case 15: {
                    return NetworkUtils$NetworkType.MOBILE_3G;
                }
            }

            return NetworkUtils$NetworkType.MOBILE;


        } catch (Throwable v0) {
            v0_2 = NetworkUtils$NetworkType.MOBILE;
        }

        return v0_2;
    }
}
